import { IntersectionType, OmitType, PartialType } from '@nestjs/swagger'
import { ListPaginationDto } from '@/shared/types/globalDto.dto'
import { QuestionRecord } from '../entities/question-record.entity'

export class CreateQuestionRecordDto extends OmitType(QuestionRecord, [
  'questionRecordId',
  'userUid',
  'question',
  'createdAt',
  'updatedAt',
]) {}

export class UpdateQuestionRecordDto extends PartialType(CreateQuestionRecordDto) {}

export class FindOneQuestionRecordDto extends PartialType(
  OmitType(QuestionRecord, ['questionRecordId', 'question', 'totalScore', 'createdAt', 'updatedAt']),
) {}

export class FindAllQuestionRecordDto extends FindOneQuestionRecordDto {}

export class ListPageQuestionRecordDto extends PartialType(
  IntersectionType(FindOneQuestionRecordDto, ListPaginationDto),
) {}

export class WebListPageQuestionRecordDto extends ListPageQuestionRecordDto {}

export class ListPageQuestionRecordVo {
  total: number
  pageNo: number
  pageSize: number
  list: QuestionRecord[]
}
